﻿using System.ComponentModel;
using System.Windows.Forms;
using HossMvp.Core;
using Sample.Views;

namespace Sample
{
    public partial class MainForm : Form
    {
        public MainForm(IPresenter<AbstractModelManager, AbstractViewManager> presenter)
        {
            this.InitializeComponent();

            // create and initialize content provider, register all form controls (IComponent implementors)
            var contentProvider = new MainView.MainViewContentProvider(this, new NameDecorator("Main"));
            contentProvider.RegisterControls<IComponent>(this);

            // create the view with the augmented provider
            presenter.ViewManager.Create<MainView>(typeof(MainView).Name, contentProvider);
        }
    }
}